#ifndef ELK_WEB_VIEW_H
#define ELK_WEB_VIEW_H

#include <QWidget>
#include "elk_web_delegate.h"

namespace Ui {
class ElkWebView;
}

class ElkWebView : public QWidget
{
    Q_OBJECT

public:
    explicit ElkWebView(QWidget *parent = 0);
    ~ElkWebView();

    QWeakPointer<ElkWebDelegate> delegate();

private slots:
    void onGotFocus();
    void onTakeFocus();
    void onUrlChanged(const QString &url);
    void onLoadingProgressChanged(double progress);

    void on_lineEditURL_returnPressed();
    void on_pushButtonLoad_clicked();

private:
    virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
    virtual void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
    virtual void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
    virtual void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;

private:
    Ui::ElkWebView *ui;
    QSharedPointer<ElkWebDelegate> delegate_;
};

#endif // ELK_WEB_VIEW_H
